/**
 * Semaphore信号量
*/
#pragma once

#include "SwTask.h"

typedef unsigned int sw_sem_t;

#define SW_SEM_INIT(sem, count) sem = count

#define SW_SEM_WAIT(s, sem)	            \
    do {						        \
        SW_WAIT_UNTIL(s, sem > 0);		\
        sem--;  				        \
    } while(0)

#define PT_SEM_SIGNAL(sem)  sem++;
